package com.arcgis.app.RecyclerView;

import android.graphics.Rect;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

public class InputSpacesItemDecoration extends RecyclerView.ItemDecoration {
    private int space;

    public InputSpacesItemDecoration(int space){
        this.space = space;
    }

    @Override
    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
//        super.getItemOffsets(outRect, view, parent, state);
        outRect.left = space * 2;
        outRect.right = space * 2;
        outRect.bottom  = space;
        outRect.top = space;
//        if (parent.getChildAdapterPosition(view) == 0){
//            outRect.top = 0;
//        }
    }
}
